cmake_minimum_required(VERSION 2.8.7)

project(kablosuz_izci)

# Set library and binary directories.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../bin)

# Set Cmake module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMake)
# set(CMAKE_DIR ${CMAKE_SOURCE_DIR}/Cmake)

# For each configuration (Debug, Release, MinSizeRel... and/or anything the user chooses)
FOREACH(CONF ${CMAKE_CONFIGURATION_TYPES})
# Go uppercase (DEBUG, RELEASE...)
STRING(TOUPPER "${CONF}" CONF)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF} ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
IF(WIN32)
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
ELSE()
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
ENDIF()
ENDFOREACH()

# Add C++0X support for gcc compiler.
#SET(CMAKE_CXX_FLAGS ${COMMON_FLAGS} -std=gnu++0x)
if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND CMAKE_CXX_FLAGS "-std=c++0x")
endif()

# Set -d postfix for debug configuration.
set(CMAKE_DEBUG_POSTFIX "-d")

set(ORTAK_DIR ${CMAKE_SOURCE_DIR}/Ortak)
set(ORTAK_INCLUDE_DIRS ${ORTAK_DIR})

set(ILETISIM_DIR ${CMAKE_SOURCE_DIR}/Iletisim)
set(ILETISIM_INCLUDE_DIRS ${ILETISIM_DIR} ${ORTAK_INCLUDE_DIRS})

set(GOSTERIM_DIR ${CMAKE_SOURCE_DIR}/Gosterim)
set(GOSTERIM_INCLUDE_DIRS ${GOSTERIM_DIR} ${ILETISIM_INCLUDE_DIRS} ${ORTAK_INCLUDE_DIRS})

set(KONTROL_DIR ${CMAKE_SOURCE_DIR}/Kontrol)
set(KONTROL_INCLUDE_DIRS ${KONTROL_DIR} ${GOSTERIM_INCLUDE_DIRS} ${ORTAK_INCLUDE_DIRS})

add_subdirectory(Ortak)
add_subdirectory(Iletisim)
add_subdirectory(Gosterim)
add_subdirectory(Test_Gosterim)
add_subdirectory(Kontrol)

# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../../doc/sunucu/docGen
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)
